package com.weixstudio.designmode.facade.demo_1;

/**
 * @ClassName EncryptFacade
 * @Description 外观者示例
 * @Author liangw
 * @Date 2022/4/23 16:46
 * @Version 1.0
 **/
public class EncryptFacade {
    private FileReader reader;
    private CiphrMachine cipher;
    private FileWriter writer;


    public EncryptFacade() {
        reader = new FileReader();
        cipher = new CiphrMachine();
        writer = new FileWriter();
    }


   public void  fileEncypt(String fileNameSrc,String fileNameDes){
        String plainStr = reader.read(fileNameSrc);
        String encryptStr = cipher.encrypt(plainStr);
        writer.write(encryptStr,fileNameDes);
   }

}
